/* pages/health/health.wxss */
.health-container {
  min-height: 100vh;
  background: #f5f7fb;
  padding-bottom: 120rpx; /* 为底部导航留空间 */
}

/* 状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx 28rpx 10rpx;
  font-size: 24rpx;
  color: #333;
}

.status-right {
  display: flex;
  gap: 16rpx;
  align-items: center;
}

/* 头部区域 */
.header {
  display: flex;
  align-items: center;
  padding: 20rpx 28rpx;
  background: #fff;
  gap: 20rpx;
}

.avatar-section {
  position: relative;
}

.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
}

.ai-badge {
  position: absolute;
  top: -8rpx;
  right: -8rpx;
  background: #10b981;
  color: #fff;
  font-size: 18rpx;
  padding: 4rpx 8rpx;
  border-radius: 8rpx;
  font-weight: bold;
}

.search-bar {
  flex: 1;
  background: #f8f9fa;
  border-radius: 24rpx;
  padding: 16rpx 24rpx;
  display: flex;
  align-items: center;
}

.search-placeholder {
  color: #999;
  font-size: 28rpx;
}

.header-actions {
  display: flex;
  gap: 20rpx;
}

.action-icon {
  width: 48rpx;
  height: 48rpx;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-icon::after {
  content: "📱";
  font-size: 24rpx;
}

.message-icon::after {
  content: "✉";
  font-size: 24rpx;
}

/* 体重进度环 */
.weight-progress {
  background: #fff;
  margin: 20rpx;
  border-radius: 20rpx;
  padding: 40rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 顶部：单位切换 与 每周计划 */
.wp-top { width: 100%; display:flex; justify-content:space-between; align-items:center; margin-bottom: 30rpx; }
.unit-switch { display:flex; background:#f1f3f9; border-radius: 999rpx; overflow:hidden; }
.unit-item { padding: 12rpx 28rpx; font-size: 26rpx; color:#889; }
.unit-item.active { background:#10b981; color:#fff; }
.weekly-plan { color:#99a; font-size: 26rpx; }
.weekly-plan .arrow { margin-left: 6rpx; }

/* 中心：已增重 */
.wp-center { text-align:center; margin: 30rpx 0 20rpx; }
.center-label-strong { font-size: 32rpx; color:#5f6b76; margin-right: 12rpx; }
.center-number { font-size: 72rpx; font-weight: 800; color:#10b981; }
.center-unit { font-size: 28rpx; color:#5f6b76; margin-left: 12rpx; }

/* 线性进度条区域 */
.weight-linear { width: 100%; position: relative; padding: 40rpx 0 60rpx; }
.progress { position: relative; height: 64rpx; background:#f1f3f6; border-radius: 999rpx; overflow: visible; }
.track { position:absolute; left:0; right:0; top:50%; height: 20rpx; transform: translateY(-50%); background:#eef1f5; border-radius: 10rpx; }
.thumb { position:absolute; top:50%; width: 48rpx; height: 48rpx; background:#10b981; border-radius: 50%; transform: translateY(-50%); box-shadow: 0 8rpx 16rpx rgba(16,185,129,.25); transition: left .35s ease; }
.percent-bubble { position:absolute; top: -22rpx; width: 120rpx; height: 60rpx; border-radius: 30rpx; background:#fff; box-shadow: 0 6rpx 16rpx rgba(0,0,0,.08); display:flex; align-items:center; justify-content:center; font-size: 28rpx; color:#10b981; transition: left .35s ease; }
.tick { position:absolute; bottom: -36rpx; width: 2rpx; height: 40rpx; background:#d9dee6; }
.tick.left { left: 30rpx; }
.tick.right { right: 30rpx; }

/* 底部：初始/目标/徽章 */
.wp-bottom { width:100%; display:flex; align-items:center; justify-content:space-between; }
.bottom-item { color:#5f6b76; }
.bottom-item.align-right { text-align:right; }
.bottom-title { font-size: 26rpx; }
.bottom-title .bold { font-weight: 800; color:#222; font-size: 40rpx; margin-left: 10rpx; }
.bottom-date { margin-top: 6rpx; font-size: 24rpx; color:#93a1ae; }
.bottom-badge { padding: 14rpx 24rpx; background:#f1fbf6; color:#10b981; border-radius: 26rpx; box-shadow: 0 6rpx 14rpx rgba(16,185,129,.12); font-size: 26rpx; }

.progress-ring {
  position: relative;
  width: 300rpx;
  height: 300rpx;
  margin-bottom: 30rpx;
}

.weight-canvas {
  width: 300rpx;
  height: 300rpx;
}

.ring-center {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.center-value {
  font-size: 48rpx;
  font-weight: bold;
  color: #10b981;
  margin-bottom: 8rpx;
}

.center-label {
  font-size: 24rpx;
  color: #666;
  margin-bottom: 8rpx;
}

.center-icon {
  font-size: 20rpx;
  color: #10b981;
}

.weight-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 20rpx;
}

.weight-item {
  text-align: center;
}

.weight-value {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 8rpx;
}

.weight-label {
  font-size: 24rpx;
  color: #666;
}

.progress-text {
  font-size: 28rpx;
  color: #10b981;
  font-weight: 500;
}

/* 饮食&运动 */
.diet-exercise {
  background: #fff;
  margin: 20rpx;
  border-radius: 20rpx;
  padding: 30rpx;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30rpx;
}

.section-title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
}

.section-subtitle {
  font-size: 24rpx;
  color: #999;
  margin-left: 16rpx;
}

.dynamic-recipes {
  display: flex;
  align-items: center;
  gap: 8rpx;
  font-size: 24rpx;
  color: #f59e0b;
}

.calorie-info {
  background: #e8f5e8;
  border-radius: 16rpx;
  padding: 24rpx;
  margin-bottom: 30rpx;
  text-align: center;
  column-count: 4;
  column-gap: 10px;
}

.calorie-box {
  display: flex;
  flex-direction: column;
}

.calorie-title {
  font-size: 24rpx;
  color: #666;
  margin-bottom: 12rpx;
}

.calorie-value {
  font-size: 48rpx;
  font-weight: bold;
  color: #10b981;
  margin-bottom: 16rpx;
}

.calorie-formula {
  font-size: 28rpx;
  color: #333;
  margin-bottom: 12rpx;
}

.formula-labels {
  display: flex;
  justify-content: space-between;
  font-size: 20rpx;
  color: #999;
}

.quick-actions {
  display: flex;
  justify-content: space-between;
  gap: 20rpx;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.action-icon {
  width: 80rpx;
  height: 80rpx;
  background: #f8f9fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32rpx;
  margin-bottom: 12rpx;
}

.action-label {
  font-size: 22rpx;
  color: #666;
}

.action-dot {
  position: absolute;
  top: 0;
  right: 20rpx;
  width: 16rpx;
  height: 16rpx;
  background: #10b981;
  border-radius: 50%;
}

/* 体重记录 */
.weight-record {
  background: #fff;
  margin: 20rpx;
  border-radius: 20rpx;
  padding: 30rpx;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30rpx;
}

.add-btn {
  width: 60rpx;
  height: 60rpx;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32rpx;
  font-weight: bold;
}

.smart-scale-btn {
  display: flex;
  align-items: center;
  gap: 12rpx;
  background: #f8f9fa;
  padding: 20rpx;
  border-radius: 16rpx;
  margin-bottom: 20rpx;
}

.scale-icon {
  font-size: 32rpx;
}

.current-weight {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 20rpx;
}

.record-info {
  background: #e8f5e8;
  padding: 20rpx;
  border-radius: 16rpx;
  text-align: center;
}

.record-badge {
  background: #10b981;
  color: #fff;
  font-size: 20rpx;
  padding: 6rpx 12rpx;
  border-radius: 12rpx;
  display: inline-block;
  margin-bottom: 8rpx;
}

.unlock-text {
  font-size: 22rpx;
  color: #666;
}

/* 其他功能 */
.other-functions {
  background: #fff;
  margin: 20rpx;
  border-radius: 20rpx;
  padding: 30rpx;
}

.function-item {
  display: flex;
  align-items: center;
  padding: 20rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
}

.function-item:last-child {
  border-bottom: none;
}

.function-icon {
  font-size: 40rpx;
  margin-right: 20rpx;
}

.function-content {
  flex: 1;
}

.function-title {
  font-size: 28rpx;
  color: #333;
  display: block;
  margin-bottom: 4rpx;
}

.function-subtitle {
  font-size: 22rpx;
  color: #999;
}

.function-add {
  width: 40rpx;
  height: 40rpx;
  background: #f0f0f0;
  color: #666;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24rpx;
}

/* 右下角功能按钮组 */
.bottom-functions {
  position: fixed;
  right: 30rpx;
  bottom: 160rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20rpx;
  z-index: 100;
}

/* 功能按钮 */
.bottom-functions .function-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20rpx;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  min-width: 120rpx;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(100rpx) scale(0.8);
  opacity: 0;
  pointer-events: none;
}

.bottom-functions .function-item.show {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.bottom-functions .function-item:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.8);
}

.bottom-functions .function-icon {
  font-size: 36rpx;
  margin-bottom: 8rpx;
}

.bottom-functions .function-label {
  font-size: 22rpx;
  color: #333;
  text-align: center;
  font-weight: 500;
}

/* 主按钮 */
.fab {
  width: 120rpx;
  height: 120rpx;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8rpx 24rpx rgba(16, 185, 129, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 101;
}

.fab.active {
  background: #ff4757;
  transform: rotate(45deg);
  box-shadow: 0 8rpx 24rpx rgba(255, 71, 87, 0.3);
}

.fab:active {
  transform: scale(0.95);
}

.fab.active:active {
  transform: scale(0.95) rotate(45deg);
}

.fab-icon {
  font-size: 48rpx;
  font-weight: bold;
  transition: all 0.3s ease;
}